Unit vector(s) with a given angle: Unit vector(s) with a given angle
Description
Unit vector with a given angle from a given unit vector.
Usage
vec(x, n = 1, deg = 90)
Arguments
x
A unit vector. If it is not a unit vector it becomes one.
n
The number of unit vectors to return.
deg
The angle between the given vector and the n vectors to be returned. This must be in degrees and it has to be between 0 and 180 degrees.
If the angle is 0, the same unit vector will be returned. If the angle is 180, the same unit vector with the signs changed will be returned.
Value
A list including:
runtime
The runtime of the procedure.
crit
The calculated angle between the given unit vector and each of the generated unit vectors.
mat
A matrix with the n unit vectors.
Details
The user provides a unit vector and the degrees. The function will return n unit vectors whose angle with the given unit vector equals the degrees given.
For example, if you want 10 unit vectors purpendicualr to the x put vec(x, 10, 90).